var QcloudSms = require("qcloudsms_js");
var appid = 1400201233
var appkey = 'ee8c1db7afe85b849d011bfd215c8df5'
var qcloudsmscase = QcloudSms(appid, appkey);
var templateID = 311334

module.exports.sendVerification =  function sendVerification(code,phone,callback){
		var ssender = qcloudsmscase.SmsSingleSender();
		var params = [code]
		ssender.sendWithParam( 86, phone, templateID,
			  [String(code)],'',"", "", function(err,res,resData){
			  	callback(err,res,resData)

			})
	}

module.exports.sendEventNotification =  function sendEventNotification(name,phone,callback){
		var ssender = qcloudsmscase.SmsSingleSender();
		ssender.sendWithParam( 86, phone, 320956,
			  [name],'',"", "", function(err,res,resData){
			  	callback(err,res,resData)
			})
	}


module.exports.sendReserveNotification =  function sendReserveNotification(name,phone,callback){
		var ssender = qcloudsmscase.SmsSingleSender();
		ssender.sendWithParam( 86, phone, 320957,
			  [name],'',"", "", function(err,res,resData){
			  	callback(err,res,resData)

			})
	}


	module.exports.sendNewReplyNotification =  function sendNewReplyNotification(name,phone,callback){
		var ssender = qcloudsmscase.SmsSingleSender();
		ssender.sendWithParam( 86, phone, 321050,
			  [name],'',"", "", function(err,res,resData){
			  	callback(err,res,resData)

			})
	}


	module.exports.sendVerifyStart =  function sendVerifyStart(phone,callback){
		var ssender = qcloudsmscase.SmsSingleSender();
		ssender.sendWithParam( 86, phone, 332954,
			  [],'',"", "", function(err,res,resData){
			  	callback(err,res,resData)

			})
	}

		module.exports.sendVerifyApprove =  function sendVerifyApprove(name,phone,callback){
		var ssender = qcloudsmscase.SmsSingleSender();
		ssender.sendWithParam( 86, phone, 332956,
			  [],'',"", "", function(err,res,resData){
			  	callback(err,res,resData)

			})
	}

		module.exports.sendVerifyFail =  function sendVerifyFail(name,phone,callback){
		var ssender = qcloudsmscase.SmsSingleSender();
		ssender.sendWithParam( 86, phone, 332959,
			  [],'',"", "", function(err,res,resData){
			  	callback(err,res,resData)

			})
	}
	module.exports.sendCoupon =  function sendCoupon(code,phone,callback){
		var ssender = qcloudsmscase.SmsSingleSender();
		var params = [code]
		ssender.sendWithParam( 86, phone, 160347,
			  [String(code)],'',"", "", function(err,res,resData){
			  	callback(err,res,resData)

			})
	}